package com.shycloud.mido.organ.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * 登录验证专用
 */
@Mapper
@Component
public interface RemoteLoginValidationMapper {

    /**
     * 通过机构编码查询机构id
     * 
     * @param code
     */
    @Select("select id from org_organization where `code` = #{code}")
    public Integer selectOrgIdByCode(@Param("code") String code);

    /**
     * 通过member查询teacherid
     * 
     * @param memberId
     * @return
     */
    @Select("select id from org_teacher_detailed where member_id = #{memberId} and org_id = #{orgId}")
    public String selectTeacherByMemberId(@Param("memberId") String memberId, @Param("orgId") Integer orgId);

    /**
     * 通过member查询staffid
     *
     * @param memberId
     * @return
     */
    @Select("select id from org_staff_detailed  where member_id = #{memberId} and org_id = #{orgId}")
    public String selectStaffByMemberId(@Param("memberId") String memberId, @Param("orgId") Integer orgId);
}